<template>
  <div class="left-menus">
        <el-menu
          default-active="1"
          class="el-menu-vertical-demo"
          background-color="#F8F8F8"
          active-text-color="#0BB976"
          unique-opened
          :collapse-transition="true"
          :collapse="false"
          :default-openeds="openeds"
          @select="selectMenu"
          @open="handleOpen"
          @close="handleClose">
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-chat-line-square"></i>
              <span>消息记录</span>
            </template>
            <el-menu-item index="/message/index"><i class="el-icon-pie-chart"></i>消息统计</el-menu-item>
            <el-menu-item index="/message/eventRecord"><i class="el-icon-notebook-1"></i>事件记录</el-menu-item>
            <el-menu-item index="/message/alarmRecord"><i class="el-icon-notebook-2"></i>告警记录</el-menu-item>
            <el-menu-item index="/message/remindRecord"><i class="el-icon-bell"></i>提醒记录</el-menu-item>
            <el-menu-item index="/message/noticeRecord"><i class="el-icon-reading"></i>通知记录</el-menu-item>
          </el-submenu>
          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-setting"></i>
              <span slot="title">消息配置</span>
            </template>
            <el-menu-item index="/message/alarmClassify"><i class="el-icon-files"></i>告警分类</el-menu-item>
            <el-menu-item index="/message/alarmSetting"><i class="el-icon-cpu"></i>告警设置</el-menu-item>
            <el-menu-item index="/message/noticeTemplate"><i class="el-icon-news"></i>通知模板</el-menu-item>
            <el-menu-item index="/message/eventClassify"><i class="el-icon-monitor"></i>事件分类</el-menu-item>
            <el-menu-item index="/message/thresholdSetting"><i class="el-icon-set-up"></i>阀值设置</el-menu-item>
          </el-submenu>
        </el-menu>
  </div>
</template>

<script>
import {getDateWeek,dateFormat}  from "@/utils/index.js";

export default {
  name: "LeftMenuMessage",
  props: {
    levelType: {
      type:Number,
      default: 1,
    }
  },
  data() {
    return {
      openeds:['1','2'],
      uniqueOpened: false
    };
  },
  created() {
    // 获取区域树
  },
  methods: {
      handleOpen(key, keyPath) {
        console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
        console.log(key, keyPath);
      },
      selectMenu(urls){
        console.log(urls);
        this.$router.push({ path: urls })
      }
  }
}
</script>

<style>
.left-menus{
  padding:0px;
}
.left-menus .el-menu{
  border-right:0px;
}
.left-menus .el-submenu__title{
  background:#e8e8e8!important;
}
</style>
